create or replace function posterminalModel2xml(bigint, text, xml)
returns xml as
$$
	declare
		modelId alias for $1;
		nameModel alias for $2;
		producerData alias for $3;
		
	begin
		return 
			xmlelement(
				name posterminalmodel, xmlattributes(modelId as id), 
				xmlelement(name posterminalmodelname, nameModel),
				producerData)
		;
	end;
$$ language plpgsql immutable; -- same result for same data